typedef struct
{
- unsigned char ident[6]; /* identifier */
+ char ident[6]; /* identifier */
unsigned char lat[4]; /* position */
unsigned char lon[4]; /* position */
unsigned char unused[4]; /* should be set to zero */
- unsigned char cmnt[40]; /* comment */
+ char cmnt[40]; /* comment */
unsigned char smbl; /* symbol id */
unsigned char dspl; /* display option */
} D103_Wpt_Type;
#if LATER
Custom_Rte_Hdr_Type CustRteHdr;
#endif
- };
+ } wpt;
};
* G103Type
*/
case 4:
- wpt_tmp->shortname = xstrndupt(rec->d103.cmnt, sizeof(rec->d103.ident));
- wpt_tmp->description = xstrndupt(rec->d103.cmnt, sizeof(rec->d103.cmnt));
+ wpt_tmp->shortname = xstrndupt(rec->wpt.d103.cmnt, sizeof(rec->wpt.d103.ident));
+ wpt_tmp->description = xstrndupt(rec->wpt.d103.cmnt, sizeof(rec->wpt.d103.cmnt));
/* This is odd. This is a Palm DB file,
* yet the data appears to be little endian,
* not appropriate the the actual Palm.
*/
- lon = le_read32(&rec->d103.lon);
- lat = le_read32(&rec->d103.lat);
+ lon = le_read32(&rec->wpt.d103.lon);
+ lat = le_read32(&rec->wpt.d103.lat);
wpt_tmp->position.longitude.degrees = lon / 2147483648.0 * 180.0;
wpt_tmp->position.latitude.degrees = lat / 2147483648.0 * 180.0;
waypt_add(wpt_tmp);
case 101:
track_head = route_head_alloc();
route_add_head(track_head);
- track_head->rte_name = xstrndup(rec->CustTrkHdr.name, sizeof(rec->CustTrkHdr.name));
- sz = be_read32(&rec->CustTrkHdr.number);
- tp = (Custom_Trk_Point_Type *) ((char *) pdb_rec->data + sizeof(rec->CustTrkHdr));
+ track_head->rte_name = xstrndup(rec->wpt.CustTrkHdr.name, sizeof(rec->wpt.CustTrkHdr.name));
+ sz = be_read32(&rec->wpt.CustTrkHdr.number);
+ tp = (Custom_Trk_Point_Type *) ((char *) pdb_rec->data + sizeof(rec->wpt.CustTrkHdr));
/* FIXME: This is incomplete and probably wrong */
while (sz--) {
wpt_tmp = xcalloc(sizeof(*wpt_tmp),1);
struct pdb *opdb;
static int ct;
-static char* rec_ptr = NULL;
-static char* current_rec = NULL;
+static ubyte* rec_ptr = NULL;
+static ubyte* current_rec = NULL;
static int rec_index = 0;
static char *dbname = NULL;
}
return QUESTION_ICON;
}
-
+#if 0
static void
-docopy(char* dest,
- const char* src,
+docopy(ubyte* dest,
+ const ubyte* src,
const int size)
{
int i;
dest[i] = src[i];
}
}
+#endif
static void
rd_init(const char *fname, const char *args)
int i;
if (current_rec == NULL) {
- char dummy = 0;
+ ubyte dummy = 0;
struct pdb_record *pdb_rec;
pdb_rec = new_Record(0, 0, ct++, 1, &dummy);
if (pdb_rec == NULL) {
rec->reserved[i] = 0;
}
- docopy(rec_ptr, (const char*)rec, sizeof(*rec));
+ memcpy(rec_ptr, rec, sizeof(*rec));
rec_ptr += sizeof(*rec);
rec_index += 1;
xfree(rec);